package com.yl.chainStore.entity.sick

import com.baomidou.mybatisplus.annotation.IdType
import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import com.yl.chainStore.common.enums.Status
import com.yl.chainStore.common.enums.TypeEnum
import com.yl.chainStore.entity.customer.CustomerInfo
import com.yl.chainStore.pojo.vo.customer.CustomerLeftJoinInfo
import com.yl.common.annotation.NoArg
import com.yl.common.getContext
import java.util.*

/**
 * <p>
 *  随访记录
 * </p>
 *
 * @author cxw
 * @since 2021-07-10
 */
@NoArg
@TableName("sick_customer_access_log")
data class SickCustomerAccessLog(

	/**
	 * id
	 */
	@TableId(value = "id", type = IdType.AUTO)
	var id: Long,

	/**
	 * 访问人
	 */
	@TableField("customer_id")
	var customerId: Long,

	/**
	 * 类型（随访，回访）
	 */
	@TableField("type")
	var type: TypeEnum = TypeEnum.ACCESS_LOG_RETURN_VISIT,

	/**
	 * 联系方式
	 */
	@TableField("contact_type")
	var contactType: TypeEnum = TypeEnum.OTHER,

	/**
	 * 创建时间
	 */
	@TableField(value = "create_time")
	var createTime: Date = Date(),

	/**
	 * 创建人
	 */
	@TableField("create_user_id")
	var createUserId: Long = getContext().userId,

	@TableField(exist = false)
	var createUserName: String? = null,
	/**
	 * 实行人（随访人员id）
	 */
	@TableField("deal_user_id")
	var dealUserId: Long,

	/**
	 * 实行人
	 */
	@TableField(exist = false)
	var dealUserName: String? = null,

	/**
	 * 医生id
	 */
	@TableField("doctor_id")
	var doctorId: Long,

	@TableField(exist = false)
	var doctorName: String? = null,

	/**
	 * 咨询师id
	 */
	@TableField("consultant_id")
	var consultantId: Long? = null,

	/**
	 * 咨询师名称
	 */
	@TableField(exist = false)
	var consultantName: String? = null,

	/**
	 * 开始时间
	 */
	@TableField("start_time")
	var startTime: Date? = null,

	/**
	 * 结束时间
	 */
	@TableField("end_time")
	var endTime: Date? = null,

	/**
	 * 实际开始时间
	 */
	@TableField("real_start_time")
	var realStartTime: Date? = null,

	/**
	 * 实际结束时间
	 */
	@TableField("finish_time")
	var finishTime: Date? = null,

	/**
	 * 状态         WAIT_AUDIT   待处理
	 *              COMPLETE     完成
	 */
	@TableField("status")
	var status: Status = Status.WAIT_AUDIT,

	/**
	 * 公司id
	 */
	@TableField("company_id")
	var companyId: Long = getContext().companyId,

	/**
	 * 分院id
	 */
	@TableField("dept_id")
	var deptId: Long = getContext().subCompanyId,

	/**
	 * 计划时间
	 */
	@TableField("plan_time")
	var planTime: Date,

	/**
	 * 随访项目
	 */
	@TableField("access_item")
	var accessItem: String? = null,

	/**
	 * 计划访问内容
	 */
	@TableField("plan_content")
	var planContent: String? = null,

	/**
	 * 反馈内容
	 */
	@TableField("back_content")
	var backContent: String? = null,

	@TableField(exist = false)
	var lastBackContent: String? = null,

	/**
	 * 备注
	 */
	@TableField("remark")
	var remark: String? = null,

	/**
	 * 项目（收费的明细）
	 */
	@TableField("order_detail_id")
	var orderDetailId: Long? = null,

	/**
	 * 第几次（回访用）
	 */
	@TableField("number_of_times")
	var numberOfTimes: Int? = null,

	/**
	 * 模版id
	 */
	@TableField("plan_detail_id")
	var planDetailId:Long ?= null,


	):CustomerLeftJoinInfo()
